﻿@model IList<AdminGroupModel>
@{
	ViewBag.Title = "管理职位";
	Layout = "~/Views/Shared/_Layout.cshtml";
}
@{
	OrganizationModel Organization = ViewData["Organization"] as OrganizationModel; 
	}
<script type="text/javascript" src="/Scripts/m-lhgdialog/m-lhgdialog.js"></script>    
<script type="text/javascript" src="/Scripts/library/m-pagination.js"></script>    
<form id="form1" runat="server">
<input type="hidden" id="hdOrgID" name="hdOrgID" value="@Organization.OrgID" />
<div class="path">
<strong>@Organization.NamePath</strong>
    </div>
    <div class="pd10">
        <div class="mb10 aL">
            <a href="javascript:void(showAdd('@Organization.OrgID'))" title="添加职位" class="a-btn1" >添加职位</a>
        </div>
          <span id="Grid">
<table class="tb-data">
<thead>
    <tr>
        <th>
            编号
        </th>
        <th>
            名称
        </th>
        <th>
            备注
        </th>
         <th  style=" width:20%">
            操作
        </th>
    </tr>
</thead>
 <tbody>
    @foreach (var item in Model)
    {
     <tr>
        <td >
           @item.GroupID
        </td>
          <td>
           @item.GroupName
        </td>         
        <td >
           @item.Memo
        </td>
        <td style="width:20%">
          <a href="javascript:void(showEdit('@item.GroupID'))">编辑</a> <a href="javascript:void(showRights('@item.GroupID'))">功能权限</a> <a href="/AdminGroup/Delete?groupID=@item.GroupID">删除</a> 
        </td>
    </tr>
    } 
	 </tbody>
</table>
        </span>
    </div>
    </form>

	 <script type="text/javascript">
	 	function showEdit(groupID) {
	 		OpenPop('/AdminGroup/edit?groupID=' + groupID, "编辑职位", 400, 250);
	 	};

	 	function showAdd(orgID) {
	 		OpenPop('/AdminGroup/edit?orgID=' + orgID, "添加职位", 400, 250);
	 	};

	 	function showRights(groupID) {
	 		OpenPop('/AdminGroup/Rights?groupID=' + groupID, "编辑权限", 800, 500);
	 	};

	 	//打开弹窗
	 	function OpenPop(url, titleName, width, height) {
	 		width = width || 800;
	 		height = height || 500;
	 		window.top.winObj = window;
	 		window.top.oDG = new $.dialog({ id: 'esDialog', title: titleName, page: url, width: width, height: height, btnBar: false, lockScroll: false });
	 		window.top.oDG.ShowDialog();
	 	}
</script>
